package com.eric.utils.satoken;
import cn.dev33.satoken.stp.StpInterface;
import com.eric.service.IUserPermissionService;
import com.eric.service.IUserRoleService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component;
import java.util.List;

/*
  用于权鉴认证获取账号权限码集合的的类
* 这个类在程序启动时不一定会执行，但在每次调用鉴权代码时，才会执行
*
* */
@Component
@RequiredArgsConstructor
public class StpInterfaceImpl implements StpInterface {
    private final IUserRoleService userRoleService;
    private final IUserPermissionService UserPermissionService;

    @Override
    public List<String> getPermissionList(Object loginId, String s) {
        return UserPermissionService.getLoginUserPermissionList(loginId,s);
    }

    @Override
    public List<String> getRoleList(Object loginId, String s) {
        return userRoleService.getLoginUserRoleList(loginId,s);
    }
}
